module default_encode_5b_to_6b(in_5b_to_6b,out_5b_to_6b);
/*
1. 5b到6b默认编码 有两种情况 
	1:一的数量和零的数量相等,此时标志位为0	
	2:一的数量是4个,0的数量是2个,此时标志位为1
	*/
input [4:0] in_5b_to_6b;
output [6:0] out_5b_to_6b;	
wire [4:0] in_5b_to_6b;
reg [6:0] out_5b_to_6b;
always @ (in_5b_to_6b)begin
	case(in_5b_to_6b)				
	//out_5b_to_6b 的 最高位用于标志 1的数量和0 的数量是否一样, 一样 为0,否则,为1,即代表有4个1
				5'h00:	 out_5b_to_6b <= 7'b1100111;
				5'h01:	 out_5b_to_6b <= 7'b1011101;
				5'h02:	 out_5b_to_6b <= 7'b1101101;
				5'h03:	 out_5b_to_6b <= 7'b0110001;
				5'h04:	 out_5b_to_6b <= 7'b1110101;
				5'h05:	 out_5b_to_6b <= 7'b0101001;
				5'h06:	 out_5b_to_6b <= 7'b0011001;
				5'h07:	 out_5b_to_6b <= 7'b0111000;
				5'h08:	 out_5b_to_6b <= 7'b1111001;
				5'h09:	 out_5b_to_6b <= 7'b0100101;
				5'h0a:	 out_5b_to_6b <= 7'b0010101;
				5'h0b:	 out_5b_to_6b <= 7'b0110100;
				5'h0c:	 out_5b_to_6b <= 7'b0001101;
				5'h0d:	 out_5b_to_6b <= 7'b0101100;
				5'h0e:	 out_5b_to_6b <= 7'b0011100;
				5'h0f: 	 out_5b_to_6b <= 7'b1010111;
				5'h10:	 out_5b_to_6b <= 7'b1011011;
				5'h11:	 out_5b_to_6b <= 7'b0100011;
				5'h12:	 out_5b_to_6b <= 7'b0010011;
				5'h13:	 out_5b_to_6b <= 7'b0110010;
				5'h14:	 out_5b_to_6b <= 7'b0001011;
				5'h15:	 out_5b_to_6b <= 7'b0101010;
				5'h16:	 out_5b_to_6b <= 7'b0011010;
				5'h17:	 out_5b_to_6b <= 7'b1111010;
				5'h18:	 out_5b_to_6b <= 7'b1110011;
				5'h19:	 out_5b_to_6b <= 7'b0100110;
				5'h1a:	 out_5b_to_6b <= 7'b0010110;
				5'h1b:	 out_5b_to_6b <= 7'b1110110;
				5'h1c:	 out_5b_to_6b <= 7'b0001110;
				5'h1d:	 out_5b_to_6b <= 7'b1101110;
				5'h1e:	 out_5b_to_6b <= 7'b1011110;
				5'h1f: 	 out_5b_to_6b <= 7'b1101011;
	endcase
end	
endmodule
